/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.liquidByte.trafficMustang.server.dataModel;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Alexandre
 */
@Entity
@Table(name = "tran_motv")
public class TransacaoMotivo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "TRAN_MOTV_ID")
    private Short tranMotvId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 40)
    @Column(name = "TRAN_MOTV_DSC")
    private String tranMotvDsc;

    public TransacaoMotivo() {
    }

    public TransacaoMotivo(Short tranMotvId) {
        this.tranMotvId = tranMotvId;
    }

    public TransacaoMotivo(Short tranMotvId, String tranMotvDsc) {
        this.tranMotvId = tranMotvId;
        this.tranMotvDsc = tranMotvDsc;
    }

    public Short getTranMotvId() {
        return tranMotvId;
    }

    public void setTranMotvId(Short tranMotvId) {
        this.tranMotvId = tranMotvId;
    }

    public String getTranMotvDsc() {
        return tranMotvDsc;
    }

    public void setTranMotvDsc(String tranMotvDsc) {
        this.tranMotvDsc = tranMotvDsc;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tranMotvId != null ? tranMotvId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TransacaoMotivo)) {
            return false;
        }
        TransacaoMotivo other = (TransacaoMotivo) object;
        if ((this.tranMotvId == null && other.tranMotvId != null) || (this.tranMotvId != null && !this.tranMotvId.equals(other.tranMotvId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.liquidByte.trafficMustang.server.dataModel.TransacaoMotivo[ tranMotvId=" + tranMotvId + " ]";
    }
    
}
